import Vue from 'vue';
import VueRouter from 'vue-router';
import FormTable from '../components/FormTable.vue';
import FormTablePage from '../components/FormTablePage.vue';
import PromiseTest from '../components/PromiseTest.vue';
import CascaderTest from '../components/CascaderTest.vue';

Vue.use(VueRouter);

const routes = [
    {
        path: '/',
        name: 'FormTable',
        component: FormTable,
    },
    {
        path: '/FormTablePage',
        name: 'FormTablePage',
        component: FormTablePage,
    },
    {
        path: '/PromiseTest',
        name: 'PromiseTest',
        component: PromiseTest,
    },
    {
        path: '/CascaderTest',
        name: 'CascaderTest',
        component: CascaderTest,
    },
];

const router = new VueRouter({
    mode: 'history', // 使用 HTML5 history 模式
    base: process.env.BASE_URL, // 根据环境变量设置基础路径
    routes,
});

export default router;